#include <stdio.h>

int sum(int (*arr)[3],int x,int y)
{
    int sum = 0;
    for(int i = 0; i < x; i++)
    {
        for(int j = 0; j < y ; j++)
        {
            sum += arr[i][j];
        }
    }
    return sum;
}

int main(int argc, char const *argv[])
{
    int a[2][3] = {1,2,3,4,5,6};
    int m = sizeof(a)/sizeof(a[0]);
    int n = sizeof(a[0])/sizeof(int);

    int total = sum(a,m,n);

    printf("%d\n",total);

    return 0;
}
